<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>星号金字塔</title>
    <style>
        body{
            background-color: #F3EFE0;
        }
        .bot{
            color: #918E84;
            font-family:Arial, Helvetica, sans-serif;
            font-size: 24px;
            position: relative;
            right: 200px;
            float: right;
        }
    </style>
    <script>
        var m;
        do{
            var n = prompt("请输入金字塔的层数n:");
            if (parseInt(n) != NaN){
                m = parseInt(n);
                break;
            }
            else alert("输入内容必须为数字n,请重试!");
        }while(true);
        for (var i = 1; i <= m; i++){
            for (var j = 1; j <= m - i; j++){
                document.write("&nbsp;");
            }
            for (var j = 1; j <= 2 * i - 1; j++){
                document.write("*");
            }
            document.write("<br>");
        }
    </script>
</head>
<body>
    <div class="bot">
        <input type="button" value="返回" onclick="location.href = '../章节目录/第二章.html'">
        <br><br><br><br>
        <h3>Please appreciate((●'◡'●))......</h3>
    </div>
</body>
</html>